﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/Admin.master" AutoEventWireup="true" CodeFile="ThemBaiViet.aspx.cs" Inherits="Admin_ThemBaiViet" %>

<%@ Register assembly="CKEditor.NET" namespace="CKEditor.NET" tagprefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript" language="javascript">
        function ShowHinh(giatri)
        {
            var hinh=document.getElementById("imgHinh");
            hinh.src="../Photos/BaiViet/"+ giatri;
            var tenhinh=document.getElementById("txtHinh");
            tenhinh.value = giatri;
        }
    </script>
<div class="formBox">
<h2>
    <asp:Label ID="TieuDe" runat="server"></asp:Label>
    </h2>
<p><a href="BaiViet.aspx">Trở về danh sách bài viết</a></p>
    <table width="100%" align="center" border="0">
        <tr>
            <td style="padding:5px;font-weight:600;">Mã bài:</td>
            <td><asp:TextBox ID="txtMaBai" runat="server" ReadOnly="True"></asp:TextBox></td>
        </tr>
        <tr>
            <td style="padding:5px;font-weight:600;">Tên bài viết:</td>
            <td><asp:TextBox ID="TextBox1" runat="server" Width="400px" MaxLength="100"></asp:TextBox></td>
        </tr>
        <tr>
            <td style="padding:5px;font-weight:600;">Bí danh:</td>
            <td><asp:TextBox ID="txtBiDanh" runat="server" Width="400px" ReadOnly="True"></asp:TextBox></td>
        </tr>
        <tr>
            <td style="padding:5px;font-weight:600;">Thể loại:</td>
            <td><asp:DropDownList ID="dsTheloai" runat="server" Width="200px">
                <asp:ListItem Value="1">Nội dung trang chủ</asp:ListItem>
                <asp:ListItem Value="2">Tin tức liên quan</asp:ListItem>
                <asp:ListItem Value="3">Cẩm nang ẩm thực</asp:ListItem>
                <asp:ListItem Value="4">Tin tức &amp; sự kiện</asp:ListItem>
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td style="padding:5px;font-weight:600;">Ngày cạp nhật:</td>
            <td><asp:TextBox ID="txtngayCapNhat" runat="server" ReadOnly="True"></asp:TextBox></td>
        </tr>
        <tr>
            <td style="padding:5px;font-weight:600;">Hình đại diện:</td>
            <td><input id="txtHinh" type="text" runat="server" readonly="true" Enabled="false" clientidmode="Static" style="width:90%;" /></td>
        </tr>
        <tr>
            <td style="padding:5px;font-weight:600;">
                <img clientidmode="Static" id="imgHinh" style="width:150px;height:150px;" runat="server" />    
            </td>
            <td>
                <select id="dsHinh" size="10" onchange="ShowHinh(this.value)" runat="server">
                
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="padding:5px;font-weight:600;">Nội dung:</td>
        <tr><td colspan="2" style="border:solid 1px #CCCCCC;">
                <CKEditor:CKEditorControl ID="CKEditorControl1" runat="server"></CKEditor:CKEditorControl>
            </td>
        </tr>
        <tr><td colspan="2" align="center">
            <asp:Label ID="ThongBao" runat="server" ForeColor="#FF3300"></asp:Label>
            </td></tr>
        <tr><td colspan="2" align="center"><asp:Button ID="btnCapNhat" runat="server" 
                Text="Cập nhật bài viết" onclick="btnCapNhat_Click" /></td></tr>
        <tr><td colspan="2">Upload hình ảnh cho bài viết lên Server</td></tr>
        <tr><td colspan="2"><asp:FileUpload ID="FileUpload1" runat="server" /></td></tr>
        <tr><td colspan="2" align="center">
            <asp:LinkButton ID="btnUpload" runat="server" onclick="btnUpload_Click">Upload</asp:LinkButton>
            </td></tr>
     </table>
</div>
</asp:Content>

